Retrieving Flight Data from the Bebop
There are two sets of files that provide details bout your Bebop's flight. The first is positional data in the form of "pud" files that record positional data. These files are written with every flight out of the box. The others, the light_run_* files, only appear after you turn on an option in the drones internal configuration. Turning on the black box To get high resolution data you will need to telnet into your drone and change a setting in a config file. You should also know that poking around in your drone can brick it. If you are not willing to risk the pain of a useless drone, you should weigh the dangers of playing with the internals carefully. The following procedures work for mac OSX, they are hacked, and the code is not sophisticated enough to handle problems or errors. It is provided as a guide for better understanding your Drone while you explore. Use it at your own discretion and without any warrantee. * Boot your drone on a fresh battery and wait for it to initalize. * Connect your Mac laptop to the Bebop WiFi instance that should appear in the selection list. * Open Terminal.app * Telnet to the drone: telnet 192.168.42.1 * The drone takes a long time before it responds to telnet... a really long time like 30 seconds so wait for it. * Once connected you will get a prompt. At that time edit the file /etc/debug.conf * near the bottom of the file change BLACKBOX = 0 to: BLACKBOX = 1 Now when you fly, a file will be written with highly detailed flight information. Retreiving the Data Retrieving the data is as easy as FTP. You can ftp directly to your drone if you connect to it the same way described above. The data is contained in two places: Low resolution flight data are named *.pud and for every flight are written in: /internal_000/Bebop_Drone/academy/ and if you turned it onthe high resolution data is in: /internal_000/blackbox The following Expect script is very raw, hacked together by someone inexperienced with tcl. Please use it as a reference only or at your own risk. I've used it a lot with great success. There is a lot of room for improvement like error handling, scriptable arguments, and a more optimized approach to running through the output and ftping the correct files. get_files_from_drone.expect: #!/usr/bin/expectset rootpath "/data/ftp/" set dirpath "internal_000/Bebop_Drone/academy" set blackboxpath "internal_000/blackbox" set timeout -1 spawn telnet 192.168.42.1 expect "*#*" send "cd $rootpath\n" expect "*#*" send "ls $blackboxpath/light_run_*\n" expect "*#*" set buffage $expect_out(buffer) send "ls $dirpath/*.pud\n" expect "*#*" set buffageb $expect_out(buffer) send "exit\n" foreach line $buffage { send_user "Testing: $line\n" unset -nocomplain dafile set dafile "" regexp {light_run_0-9*} $line dafile if {length $dafile > 1} { set remotefile "$blackboxpath/$dafile" send_user "Getting: $dafile\n" spawn ftp 192.168.42.1 expect "*Name*" send "\n" expect "ftp>" send "recv $remotefile $dafile\n" expect "ftp>" send_user "Done: $dafile\n" send "quit\n" send_user "\n" } } foreach line $buffageb { send_user "Testing: $line\n" set dafile "" set pattern "$dirpath/.*.pud" regexp {0-9{4}_.*pud} $line dafile if {length $dafile > 1} { set remotefile "$dirpath/$dafile" send_user "Getting: $dafile\n" spawn ftp 192.168.42.1 expect "*Name*" send "\n" expect "ftp>" send "recv $remotefile $dafile\n" expect "ftp>" send_user "Done: $dafile\n" send "quit\n" send_user "\n" } }